package ai.people.netmon.utils;

import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * 图片 工具类
 *
 * @author zhenglin
 * @date 2022/4/12
 */
public class PictureUtils {

    private static final List<String> SUFFIX_LIST = List.of("xbm", "tif", "pjp", "svgz", "jpg", "jpeg", "ico", "tiff", "gif", "svg", "jfif", "webp", "png", ".bmp", "pjpeg", "avif");

    public static boolean checkSuffix(String name) {
        if (StringUtils.isBlank(name)){
            return false;
        }
        String[] split = name.split("\\.");
        String suffix = split[split.length - 1];
        return SUFFIX_LIST.contains(suffix);
    }

}
